
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Android.mk · Aivin开发笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Aivin">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Application.mk模板.html" />
    
    
    <link rel="prev" href="cmake方式.html" />
    

    
        <link rel="shortcut icon" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    项目说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../linux/linux基础.html">
            
                <a href="../linux/linux基础.html">
            
                    
                    linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../linux/linux基础.html">
            
                <a href="../linux/linux基础.html">
            
                    
                    linux基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../linux/android底层开发.html">
            
                <a href="../linux/android底层开发.html">
            
                    
                    android底层开发
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../c语言/c基础.html">
            
                <a href="../c语言/c基础.html">
            
                    
                    c
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../c语言/c基础.html">
            
                <a href="../c语言/c基础.html">
            
                    
                    c基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../c++/c++基础.html">
            
                <a href="../c++/c++基础.html">
            
                    
                    c++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../c++/c++基础.html">
            
                <a href="../c++/c++基础.html">
            
                    
                    c++基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../QT/QT基础.html">
            
                <a href="../QT/QT基础.html">
            
                    
                    QT
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../QT/QT基础.html">
            
                <a href="../QT/QT基础.html">
            
                    
                    QT基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../jni/JNI基础.html">
            
                <a href="../jni/JNI基础.html">
            
                    
                    JNI
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../jni/JNI基础.html">
            
                <a href="../jni/JNI基础.html">
            
                    
                    JNI基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../jni/JNI例子.html">
            
                <a href="../jni/JNI例子.html">
            
                    
                    JNI例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../SDL/SDL基础.html">
            
                <a href="../SDL/SDL基础.html">
            
                    
                    SDL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../SDL/SDL基础.html">
            
                <a href="../SDL/SDL基础.html">
            
                    
                    SDL基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ffmpeg/ffmpeg基础.html">
            
                <a href="../ffmpeg/ffmpeg基础.html">
            
                    
                    ffmpeg
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ffmpeg/ffmpeg基础.html">
            
                <a href="../ffmpeg/ffmpeg基础.html">
            
                    
                    ffmpeg基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../ffmpeg/ffmpeg示例代码.html">
            
                <a href="../ffmpeg/ffmpeg示例代码.html">
            
                    
                    ffmpeg示例代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../ffmpeg/ffmpeg软解rtsp简单直播.html">
            
                <a href="../ffmpeg/ffmpeg软解rtsp简单直播.html">
            
                    
                    ffmpeg软解rtsp简单直播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../ffmpeg/rtsp服务器.html">
            
                <a href="../ffmpeg/rtsp服务器.html">
            
                    
                    rtsp服务器Windows
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../opencv/opencv模块.html">
            
                <a href="../opencv/opencv模块.html">
            
                    
                    opencv模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../opencv/opencv.html">
            
                <a href="../opencv/opencv.html">
            
                    
                    opencv
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../openSLES/openSLES基础.html">
            
                <a href="../openSLES/openSLES基础.html">
            
                    
                    openSLES
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../openSLES/openSLES基础.html">
            
                <a href="../openSLES/openSLES基础.html">
            
                    
                    openSLES基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../SoundTouch/移植SoundTouch.html">
            
                <a href="../SoundTouch/移植SoundTouch.html">
            
                    
                    SoundTouch
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../SoundTouch/移植SoundTouch.html">
            
                <a href="../SoundTouch/移植SoundTouch.html">
            
                    
                    移植SoundTouch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../SoundTouch/实现音频变速和变调.html">
            
                <a href="../SoundTouch/实现音频变速和变调.html">
            
                    
                    实现音频变速和变调
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../openGLES/openGLES基础.html">
            
                <a href="../openGLES/openGLES基础.html">
            
                    
                    openGLES模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../openGLES/GLSL基础.html">
            
                <a href="../openGLES/GLSL基础.html">
            
                    
                    GLSL基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../openGLES/openglES示例.html">
            
                <a href="../openGLES/openglES示例.html">
            
                    
                    openglES示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../视频相关/音视频基础.html">
            
                <a href="../视频相关/音视频基础.html">
            
                    
                    音视频术语-文件格式-协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../视频相关/音视频基础.html">
            
                <a href="../视频相关/音视频基础.html">
            
                    
                    音视频基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../视频相关/RTSP.html">
            
                <a href="../视频相关/RTSP.html">
            
                    
                    RTSP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../视频相关/RTP.html">
            
                <a href="../视频相关/RTP.html">
            
                    
                    RTP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../视频相关/RTCP.html">
            
                <a href="../视频相关/RTCP.html">
            
                    
                    RTCP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../视频相关/H264.html">
            
                <a href="../视频相关/H264.html">
            
                    
                    H264
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../视频相关/YUV.html">
            
                <a href="../视频相关/YUV.html">
            
                    
                    YUV
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../视频相关/SurfaceView.html">
            
                <a href="../视频相关/SurfaceView.html">
            
                    
                    SurfaceView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../视频相关/RTMP.html">
            
                <a href="../视频相关/RTMP.html">
            
                    
                    RTMP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="../视频相关/AAC详解.html">
            
                <a href="../视频相关/AAC详解.html">
            
                    
                    AAC详解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../音视频相关代码/音视频相关代码.html">
            
                <a href="../音视频相关代码/音视频相关代码.html">
            
                    
                    音视频相关代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="NDK编译基础.html">
            
                <a href="NDK编译基础.html">
            
                    
                    NDK工程编译
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="NDK编译基础.html">
            
                <a href="NDK编译基础.html">
            
                    
                    NDK编译基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="cmake方式.html">
            
                <a href="cmake方式.html">
            
                    
                    cmake
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.15.3" data-path="Android.mk模板.html">
            
                <a href="Android.mk模板.html">
            
                    
                    Android.mk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="Application.mk模板.html">
            
                <a href="Application.mk模板.html">
            
                    
                    Application.mk
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Android.mk</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#androidmk-&#x6A21;&#x677F;"><b>1. </b>Android.mk &#x6A21;&#x677F;</a></li><ul><li><span class="title-icon "></span><a href="#androidmk-&#x914D;&#x7F6E;&#x793A;&#x4F8B;"><b>1.1. </b>Android.mk &#x914D;&#x7F6E;&#x793A;&#x4F8B;</a></li><li><span class="title-icon "></span><a href="#androidmk-&#x90E8;&#x5206;&#x89E3;&#x91CA;"><b>1.2. </b>Android.mk &#x90E8;&#x5206;&#x89E3;&#x91CA;</a></li><ul><li><span class="title-icon "></span><a href="#localpath--call-my-dir"><b>1.2.1. </b>LOCAL_PATH := $(call my-dir)</a></li><li><span class="title-icon "></span><a href="#include-clearvars"><b>1.2.2. </b>include $(CLEAR_VARS)</a></li><li><span class="title-icon "></span><a href="#localmodule--hello-jni"><b>1.2.3. </b>LOCAL_MODULE := hello-jni</a></li><li><span class="title-icon "></span><a href="#localsrcfiles--hello-jnic"><b>1.2.4. </b>LOCAL_SRC_FILES := hello-jni.c</a></li></ul><li><span class="title-icon "></span><a href="#&#x53D8;&#x91CF;&#x548C;&#x5B8F;"><b>1.3. </b>&#x53D8;&#x91CF;&#x548C;&#x5B8F;</a></li><ul><li><span class="title-icon "></span><a href="#&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;"><b>1.3.1. </b>&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;</a></li><li><span class="title-icon "></span><a href="#&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;"><b>1.3.2. </b>&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;</a></li></ul><li><span class="title-icon "></span><a href="#&#x5176;&#x4ED6;"><b>1.4. </b>&#x5176;&#x4ED6;</a></li></ul></ul></div><a href="#androidmk-&#x6A21;&#x677F;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="androidmk-&#x6A21;&#x677F;"><a name="androidmk-&#x6A21;&#x677F;" class="anchor-navigation-ex-anchor" href="#androidmk-&#x6A21;&#x677F;"><i class="fa fa-link" aria-hidden="true"></i></a>1. Android.mk &#x6A21;&#x677F;</h1>
<p>android_mk <a href="https://developer.android.google.cn/ndk/guides/android_mk.html#over" target="_blank"> &#x5B98;&#x65B9;&#x53C2;&#x8003;</a></p>
<h2 id="androidmk-&#x914D;&#x7F6E;&#x793A;&#x4F8B;"><a name="androidmk-&#x914D;&#x7F6E;&#x793A;&#x4F8B;" class="anchor-navigation-ex-anchor" href="#androidmk-&#x914D;&#x7F6E;&#x793A;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. Android.mk &#x914D;&#x7F6E;&#x793A;&#x4F8B;</h2>
<pre><code class="lang-mk">LOCAL_PATH := <span class="hljs-variable">$(call my-dir)</span>
include $(CLEAR_VARS)
LOCAL_C_INCLUDES += <span class="hljs-variable">$(LOCAL_PATH)</span>/../libffmpeg  \
    $(LOCAL_PATH)/hardCodec

LOCAL_MODULE := libhiesproto
ALL_DEFAULT_INSTALLED_MODULES += <span class="hljs-variable">$(LOCAL_MODULE)</span>
LOCAL_STATIC_LIBRARIES := libyuv2rgb_neon
LOCAL_SRC_FILES += Hies_proto.c \
    comm_utils.c \
    mbuffer/HiMbuffer.c

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libh265decoder
LOCAL_SRC_FILES := hardCodec/H265/lib/libHW_H265dec_Andr.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_CFLAGS := -D__STDC_CONSTANT_MACROS -DHI_OS_ANDROID -DHI_MEDIA_CODEC_DECODING

WITH_ANDROID_VECTOR := true
include $(LOCAL_PATH)/../utils.mk
LOCAL_C_INCLUDES += \
    $(LOCAL_PATH)/../libffmpeg \
    $(LOCAL_PATH)/../arm_neon \
    $(LOCAL_PATH)/../jni \

LOCAL_SRC_FILES := \
    mediaplayer.cpp \
    nativeWindow.cpp \
    mbuffer/HiMbuffer.c \

RTSP_PROTO_INC := \
    $(LOCAL_PATH)/hardCodec/protocol/HiRtspClient \
    $(LOCAL_PATH)/hardCodec/protocol/HiRtspClient/rtspclient/include \
    $(LOCAL_PATH)/hardCodec/protocol/HiRtspClient/rtspclient/src

RTSP_PROTO_SRC := <span class="hljs-variable">$(wildcard $(LOCAL_PATH)</span>/hardCodec/protocol/HiRtspClient/rtspclient/src/*.c)

LOCAL_C_INCLUDES += <span class="hljs-variable">$(RTSP_PROTO_INC)</span>
LOCAL_SRC_FILES += <span class="hljs-variable">$(patsubst $(LOCAL_PATH)</span>/%, %, <span class="hljs-variable">$(RTSP_PROTO_SRC)</span>)
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := libffmpeg libmpp libvpu
LOCAL_STATIC_LIBRARIES :=libHWAHStreaming libyuv2rgb_neon libhiesproto libh265decoder

LOCAL_LDLIBS += -llog -lz -lm -ldl
LOCAL_MODULE := libahplayer
ALL_DEFAULT_INSTALLED_MODULES += <span class="hljs-variable">$(LOCAL_MODULE)</span>
include $(BUILD_STATIC_LIBRARY)
</code></pre>
<h2 id="androidmk-&#x90E8;&#x5206;&#x89E3;&#x91CA;"><a name="androidmk-&#x90E8;&#x5206;&#x89E3;&#x91CA;" class="anchor-navigation-ex-anchor" href="#androidmk-&#x90E8;&#x5206;&#x89E3;&#x91CA;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2. Android.mk &#x90E8;&#x5206;&#x89E3;&#x91CA;</h2>
<h3 id="localpath--call-my-dir"><a name="localpath--call-my-dir" class="anchor-navigation-ex-anchor" href="#localpath--call-my-dir"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.1. LOCAL_PATH := $(call my-dir)</h3>
<pre><code class="lang-xml">&#x8868;&#x793A;&#x6E90;&#x6587;&#x4EF6;&#x5728;&#x5F00;&#x53D1;&#x6811;&#x4E2D;&#x7684;&#x4F4D;&#x7F6E;&#x3002;
&#x5728;&#x8FD9;&#x91CC;&#xFF0C;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x63D0;&#x4F9B;&#x7684;&#x5B8F;&#x51FD;&#x6570; my-dir &#x5C06;&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#xFF08;&#x5373;Android.mk&#x6587;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x76EE;&#x5F55;&#xFF09;&#x7684;&#x8DEF;&#x5F84;&#x3002;
</code></pre>
<h3 id="include-clearvars"><a name="include-clearvars" class="anchor-navigation-ex-anchor" href="#include-clearvars"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.2. include $(CLEAR_VARS)</h3>
<pre><code class="lang-xml">CLEAR_VARS &#x53D8;&#x91CF;
&#x5176;&#x503C;&#x7531;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x63D0;&#x4F9B;&#x3002;&#x6307;&#x5411;&#x7279;&#x6B8A; GNU Makefile&#xFF0C;&#x53EF;&#x4E3A;&#x60A8;&#x6E05;&#x9664;&#x8BB8;&#x591A; LOCAL_XXX &#x53D8;&#x91CF;&#xFF0C;
&#x4F8B;&#x5982; LOCAL_MODULE&#x3001;LOCAL_SRC_FILES &#x548C; LOCAL_STATIC_LIBRARIES&#x3002;
&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x5B83;&#x4E0D;&#x4F1A;&#x6E05;&#x9664; LOCAL_PATH&#x3002;&#x6B64;&#x53D8;&#x91CF;&#x5FC5;&#x987B;&#x4FDD;&#x7559;&#x5176;&#x503C;&#xFF0C;&#x56E0;&#x4E3A;&#x7CFB;&#x7EDF;&#x5728;&#x5355;&#x4E00; GNU Make &#x6267;&#x884C;&#x73AF;&#x5883;&#xFF08;&#x5176;&#x4E2D;&#x6240;&#x6709;&#x53D8;&#x91CF;&#x90FD;&#x662F;&#x5168;&#x5C40;&#x7684;&#xFF09;&#x4E2D;&#x89E3;&#x6790;&#x6240;&#x6709;&#x6784;&#x5EFA;&#x63A7;&#x5236;&#x6587;&#x4EF6;&#x3002;
&#x5728;&#x63CF;&#x8FF0;&#x6BCF;&#x4E2A;&#x6A21;&#x5757;&#x4E4B;&#x524D;&#xFF0C;&#x5FC5;&#x987B;&#x58F0;&#x660E;&#xFF08;&#x91CD;&#x65B0;&#x58F0;&#x660E;&#xFF09;&#x6B64;&#x53D8;&#x91CF;&#x3002;
</code></pre>
<h3 id="localmodule--hello-jni"><a name="localmodule--hello-jni" class="anchor-navigation-ex-anchor" href="#localmodule--hello-jni"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.3. LOCAL_MODULE := hello-jni</h3>
<pre><code class="lang-xml">LOCAL_MODULE &#x53D8;&#x91CF;
&#x5C06;&#x5B58;&#x50A8;&#x60A8;&#x8981;&#x6784;&#x5EFA;&#x7684;&#x6A21;&#x5757;&#x7684;&#x540D;&#x79F0;&#x3002;&#x6BCF;&#x4E2A;&#x6A21;&#x5757;&#x540D;&#x79F0;&#x5FC5;&#x987B;&#x552F;&#x4E00;&#xFF0C;&#x4E14;&#x4E0D;&#x542B;&#x4EFB;&#x4F55;&#x7A7A;&#x683C;&#x3002;
</code></pre>
<h3 id="localsrcfiles--hello-jnic"><a name="localsrcfiles--hello-jnic" class="anchor-navigation-ex-anchor" href="#localsrcfiles--hello-jnic"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.4. LOCAL_SRC_FILES := hello-jni.c</h3>
<pre><code class="lang-xml">&#x6700;&#x540E;&#x4E00;&#x884C;&#x5E2E;&#x52A9;&#x7CFB;&#x7EDF;&#x5C06;&#x6240;&#x6709;&#x5185;&#x5BB9;&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x8D77;&#x3002;
include $(BUILD_SHARED_LIBRARY)

BUILD_SHARED_LIBRARY &#x53D8;&#x91CF;
&#x6307;&#x5411; GNU Makefile &#x811A;&#x672C;&#xFF0C;&#x7528;&#x4E8E;&#x6536;&#x96C6;&#x60A8;&#x81EA;&#x6700;&#x8FD1; include &#x540E;&#x5728; LOCAL_XXX &#x53D8;&#x91CF;&#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x6240;&#x6709;&#x4FE1;&#x606F;&#x3002;
</code></pre>
<h2 id="&#x53D8;&#x91CF;&#x548C;&#x5B8F;"><a name="&#x53D8;&#x91CF;&#x548C;&#x5B8F;" class="anchor-navigation-ex-anchor" href="#&#x53D8;&#x91CF;&#x548C;&#x5B8F;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3. &#x53D8;&#x91CF;&#x548C;&#x5B8F;</h2>
<pre><code class="lang-xml">&#x7CFB;&#x7EDF;&#x63D0;&#x4F9B;&#x8BB8;&#x591A;&#x53EF;&#x7528;&#x4E8E; Android.mk &#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x53D8;&#x91CF;&#x3002;
&#x9664;&#x4E86;&#x8FD9;&#x4E9B;&#x53D8;&#x91CF;&#x4E4B;&#x5916;&#xFF0C;&#x60A8;&#x8FD8;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x81EA;&#x5DF1;&#x7684;&#x4EFB;&#x610F;&#x53D8;&#x91CF;&#x3002;
&#x4E3A;&#x4E86;&#x4FBF;&#x4E8E;&#x8FA8;&#x8BA4;&#xFF0C;&#x81EA;&#x5B9A;&#x4E49;&#x53D8;&#x91CF;&#x5EFA;&#x8BAE;&#x5728;&#x540D;&#x79F0;&#x524D;&#x9644;&#x52A0; MY_&#x3002;
</code></pre>
<h3 id="&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;"><a name="&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;" class="anchor-navigation-ex-anchor" href="#&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.1. &#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x53D8;&#x91CF;</h3>
<table>
<thead>
<tr>
<th>NDK &#x5B9A;&#x4E49;&#x7684;&#x53D8;&#x91CF;</th>
<th>&#x542B;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td>CLEAR_VARS</td>
<td>&#x53D6;&#x6D88;&#x5B9A;&#x4E49;LOCAL_XXX &#x53D8;&#x91CF;&#x3002;</td>
</tr>
<tr>
<td>BUILD_SHARED_LIBRARY</td>
<td>&#x6784;&#x5EFA;&#x52A8;&#x6001;&#x5E93;</td>
</tr>
<tr>
<td>BUILD_STATIC_LIBRARY</td>
<td>&#x6784;&#x5EFA;&#x9759;&#x6001;&#x5E93;</td>
</tr>
<tr>
<td>PREBUILT_SHARED_LIBRARY</td>
<td>&#x5F15;&#x7528;&#x53E6;&#x4E00;&#x4E2A;&#x6A21;&#x5757;&#x4E2D;&#x7684;&#x9884;&#x5EFA;&#x5E93;</td>
</tr>
<tr>
<td>PREBUILT_STATIC_LIBRARY</td>
<td></td>
</tr>
<tr>
<td>TARGET_ARCH</td>
<td>CPU &#x67B6;&#x6784;&#x7684;&#x540D;&#x79F0;</td>
</tr>
<tr>
<td>TARGET_ARCH_ABI</td>
<td>&#x4F7F;&#x7528;&#x7A7A;&#x683C;&#x4F5C;&#x4E3A;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x4E4B;&#x95F4;&#x7684;&#x5206;&#x9694;&#x7B26;</td>
</tr>
<tr>
<td>TARGET_PLATFORM</td>
<td>&#x4F5C;&#x4E3A;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x76EE;&#x6807;&#x7684; Android API &#x7EA7;&#x522B;&#x53F7;</td>
</tr>
<tr>
<td>TARGET_ABI</td>
<td></td>
</tr>
<tr>
<td>LOCAL_PATH</td>
<td>&#x6307;&#x5B9A;&#x5F53;&#x524D;&#x6587;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;</td>
</tr>
<tr>
<td>LOCAL_MODULE</td>
<td>&#x6A21;&#x5757;&#x7684;&#x540D;&#x79F0;</td>
</tr>
<tr>
<td>LOCAL_MODULE_FILENAME</td>
<td>&#x5F3A;&#x5236;&#x6539;&#x53D8;.so&#x7684;&#x6587;&#x4EF6;&#x540D;</td>
</tr>
<tr>
<td>LOCAL_SRC_FILES</td>
<td>&#x6E90;&#x6587;&#x4EF6;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_CPP_EXTENSION</td>
<td>&#x4E3A; C++ &#x6E90;&#x6587;&#x4EF6;&#x6307;&#x660E; .cpp &#x4EE5;&#x5916;&#x7684;&#x6587;&#x4EF6;&#x6269;&#x5C55;&#x540D;</td>
</tr>
<tr>
<td>LOCAL_CPP_FEATURES</td>
<td>&#x6307;&#x660E;&#x60A8;&#x7684;&#x4EE3;&#x7801;&#x4F9D;&#x8D56;&#x4E8E;&#x7279;&#x5B9A; C++ &#x529F;&#x80FD;</td>
</tr>
<tr>
<td>LOCAL_C_INCLUDES</td>
<td>&#x6307;&#x5B9A;&#x76F8;&#x5BF9;&#x4E8E; NDK root &#x76EE;&#x5F55;&#x7684;&#x8DEF;&#x5F84;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_CFLAGS</td>
<td>&#x8BBE;&#x7F6E;&#x5728;&#x6784;&#x5EFA; C &#x548C; C++ &#x6E90;&#x6587;&#x4EF6;&#x65F6;&#x8981;&#x4F20;&#x9012;&#x7684;&#x7F16;&#x8BD1;&#x5668;&#x6807;&#x5FD7;&#x3002;</td>
</tr>
<tr>
<td>LOCAL_CPPFLAGS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_STATIC_LIBRARIES</td>
<td>&#x5B58;&#x50A8;&#x5F53;&#x524D;&#x6A21;&#x5757;&#x4F9D;&#x8D56;&#x7684;&#x9759;&#x6001;&#x5E93;&#x6A21;&#x5757;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_SHARED_LIBRARIES</td>
<td>&#x4F9D;&#x8D56;&#x7684;&#x5171;&#x4EAB;&#x5E93;&#x6A21;&#x5757;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_WHOLE_STATIC_LIBRARIES</td>
<td>&#x8868;&#x793A;&#x94FE;&#x63A5;&#x5668;&#x5E94;&#x5C06;&#x76F8;&#x5173;&#x7684;&#x5E93;&#x6A21;&#x5757;&#x89C6;&#x4E3A;&#x6574;&#x4E2A;&#x5B58;&#x6863;</td>
</tr>
<tr>
<td>LOCAL_LDLIBS</td>
<td>&#x5176;&#x4ED6;&#x94FE;&#x63A5;&#x5668;&#x6807;&#x5FD7;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_LDFLAGS</td>
<td>&#x5176;&#x4ED6;&#x94FE;&#x63A5;&#x5668;&#x6807;&#x5FD7;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>LOCAL_ALLOW_UNDEFINED_SYMBOLS</td>
<td>&#x6355;&#x83B7;&#x201C;&#x672A;&#x5B9A;&#x4E49;&#x7684;&#x7B26;&#x53F7;&#x201D;&#x9519;&#x8BEF;</td>
</tr>
<tr>
<td>LOCAL_ARM_MODE</td>
<td></td>
</tr>
<tr>
<td>LOCAL_ARM_NEON</td>
<td></td>
</tr>
<tr>
<td>LOCAL_DISABLE_NO_EXECUTE</td>
<td></td>
</tr>
<tr>
<td>LOCAL_DISABLE_RELRO</td>
<td></td>
</tr>
<tr>
<td>LOCAL_DISABLE_FORMAT_STRING_CHECKS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_EXPORT_CFLAGS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_EXPORT_CPPFLAGS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_EXPORT_C_INCLUDES</td>
<td></td>
</tr>
<tr>
<td>LOCAL_EXPORT_LDFLAGS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_EXPORT_LDLIBS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_SHORT_COMMANDS</td>
<td></td>
</tr>
<tr>
<td>LOCAL_THIN_ARCHIVE</td>
<td></td>
</tr>
<tr>
<td>LOCAL_FILTER_ASM</td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;"><a name="&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;" class="anchor-navigation-ex-anchor" href="#&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3.2. &#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;&#x51FD;&#x6570;&#x5B8F;</h3>
<table>
<thead>
<tr>
<th>NDK &#x63D0;&#x4F9B;&#x7684;&#x51FD;&#x6570;&#x5B8F;</th>
<th>&#x542B;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td>my-dir</td>
<td>&#x8FD4;&#x56DE;&#x6700;&#x540E;&#x5305;&#x542B;&#x7684; makefile &#x7684;&#x8DEF;&#x5F84;&#xFF0C;&#x901A;&#x5E38;&#x662F;&#x5F53;&#x524D; Android.mk &#x7684;&#x76EE;&#x5F55;</td>
</tr>
<tr>
<td>all-subdir-makefiles</td>
<td>&#x8FD4;&#x56DE;&#x4F4D;&#x4E8E;&#x5F53;&#x524D; my-dir &#x8DEF;&#x5F84;&#x6240;&#x6709;&#x5B50;&#x76EE;&#x5F55;&#x4E2D;&#x7684; Android.mk &#x6587;&#x4EF6;&#x5217;&#x8868;</td>
</tr>
<tr>
<td>this-makefile</td>
<td>&#x8FD4;&#x56DE;&#x5F53;&#x524D; makefile &#x7684;&#x8DEF;&#x5F84;</td>
</tr>
<tr>
<td>parent-makefile</td>
<td>&#x8FD4;&#x56DE;&#x5305;&#x542B;&#x6811;&#x4E2D;&#x7236; makefile &#x7684;&#x8DEF;&#x5F84;</td>
</tr>
<tr>
<td>grand-parent-makefile</td>
<td>&#x8FD4;&#x56DE;&#x5305;&#x542B;&#x6811;&#x4E2D;&#x7956;&#x7236; makefile &#x7684;&#x8DEF;&#x5F84;</td>
</tr>
<tr>
<td>import-module</td>
<td>&#x6309;&#x6A21;&#x5757;&#x7684;&#x540D;&#x79F0;&#x67E5;&#x627E;&#x548C;&#x5305;&#x542B;&#x6A21;&#x5757;&#x7684; Android.mk  </td>
</tr>
</tbody>
</table>
<h2 id="&#x5176;&#x4ED6;"><a name="&#x5176;&#x4ED6;" class="anchor-navigation-ex-anchor" href="#&#x5176;&#x4ED6;"><i class="fa fa-link" aria-hidden="true"></i></a>1.4. &#x5176;&#x4ED6;</h2>
<pre><code class="lang-xml">if [ $? -eq 0 ]
$?&#x662F;shell&#x53D8;&#x91CF;,&#x8868;&#x793A;&quot;&#x6700;&#x540E;&#x4E00;&#x6B21;&#x6267;&#x884C;&#x547D;&#x4EE4;&quot;&#x7684;&#x9000;&#x51FA;&#x72B6;&#x6001;.0&#x4E3A;&#x6210;&#x529F;,&#x975E;0&#x4E3A;&#x5931;&#x8D25;.
</code></pre>
<footer class="page-footer"><span class="copyright">&#x65E0;&#x7248;&#x6743; &#x53EF;&#x4EE5;&#x65E0;&#x9650;&#x5236;&#x4F7F;&#x7528;&#xFF01; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x66F4;&#x65B0;&#x65F6;&#x95F4;&#xFF1A;
2019-12-18 14:42:27
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="cmake方式.html" class="navigation navigation-prev " aria-label="Previous page: cmake">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Application.mk模板.html" class="navigation navigation-next " aria-label="Next page: Application.mk">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Android.mk","level":"1.15.3","depth":2,"next":{"title":"Application.mk","level":"1.15.4","depth":2,"path":"chinese/ndk/Application.mk模板.md","ref":"chinese/ndk/Application.mk模板.md","articles":[]},"previous":{"title":"cmake","level":"1.15.2","depth":2,"path":"chinese/ndk/cmake方式.md","ref":"chinese/ndk/cmake方式.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","search-plus","todo","anchor-navigation-ex","copy-code-button","versions-select","fontsettings","sharing","tbfed-pagefooter","donate","local-video","splitter","edit-link","expandable-chapters","favicon","theme-comscore","local-video"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"无版权 可以无限制使用！","modify_label":"该文件更新时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"todo":{},"splitter":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"versions-select":{"type":"branches"},"donate":{"alipay":"https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201803011956_osChina_支付宝收款码.png","alipayText":"支付宝打赏","button":"打赏","title":"","wechat":"https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201803011956_osChina_微信收款码.png","wechatText":"微信打赏"},"fontsettings":{"family":"sans","size":2,"theme":"sepia"},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"favicon":{"shortcut":"assets/images/favicon.ico","bookmark":"assets/images/favicon.ico"},"theme-comscore":{},"local-video":{},"copy-code-button":{},"versions":{"options":[{"value":"https://www.aivin666.cn/java_android/","text":"v1.0"}]},"sharing":{"all":["facebook","google","twitter","weibo","instapaper"],"facebook":false,"google":true,"instapaper":false,"twitter":false,"vk":false,"weibo":true},"edit-link":{"label":"托管页面","base":"https://www.baidu.com/"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"Aivin","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Aivin开发笔记","language":"zh-hans","gitbook":"*","description":"Aivin开发笔记"},"file":{"path":"chinese/ndk/Android.mk模板.md","mtime":"2019-12-18T06:42:27.162Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-12-24T10:38:14.517Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

